package com.ruoyi.web.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.mapper.ArBorrowDetailMapper;
import com.ruoyi.web.domain.ArBorrowDetail;
import com.ruoyi.web.service.IArBorrowDetailService;

/**
 * 借阅详情Service业务层处理
 *
 * @author ruoyi
 * @date 2022-02-15
 */
@Service
public class ArBorrowDetailServiceImpl implements IArBorrowDetailService
{
    @Autowired
    private ArBorrowDetailMapper arBorrowDetailMapper;

    /**
     * 查询借阅详情
     *
     * @param recNo 借阅详情ID
     * @return 借阅详情
     */
    @Override
    public ArBorrowDetail selectArBorrowDetailById(String recNo)
    {
        return arBorrowDetailMapper.selectArBorrowDetailById(recNo);
    }

    /**
     * 查询借阅详情列表
     *
     * @param arBorrowDetail 借阅详情
     * @return 借阅详情
     */
    @Override
    public List<ArBorrowDetail> selectArBorrowDetailList(ArBorrowDetail arBorrowDetail)
    {
        return arBorrowDetailMapper.selectArBorrowDetailList(arBorrowDetail);
    }

    /**
     * 新增借阅详情
     *
     * @param arBorrowDetail 借阅详情
     * @return 结果
     */
    @Override
    public int insertArBorrowDetail(ArBorrowDetail arBorrowDetail)
    {
        arBorrowDetail.setCreateTime(DateUtils.getNowDate());
        return arBorrowDetailMapper.insertArBorrowDetail(arBorrowDetail);
    }

    /**
     * 修改借阅详情
     *
     * @param arBorrowDetail 借阅详情
     * @return 结果
     */
    @Override
    public int updateArBorrowDetail(ArBorrowDetail arBorrowDetail)
    {
        arBorrowDetail.setUpdateTime(DateUtils.getNowDate());
        return arBorrowDetailMapper.updateArBorrowDetail(arBorrowDetail);
    }

    /**
     * 批量删除借阅详情
     *
     * @param recNos 需要删除的借阅详情ID
     * @return 结果
     */
    @Override
    public int deleteArBorrowDetailByIds(String[] recNos)
    {
        return arBorrowDetailMapper.deleteArBorrowDetailByIds(recNos);
    }

    /**
     * 删除借阅详情信息
     *
     * @param recNo 借阅详情ID
     * @return 结果
     */
    @Override
    public int deleteArBorrowDetailById(String recNo)
    {
        return arBorrowDetailMapper.deleteArBorrowDetailById(recNo);
    }

}
